FROM centos:7

MAINTAINER Yang <yangyufans@qq.com>

ENV NGINX_VERSION=1.15.0

RUN yum install -y wget make gcc pcre-devel gzip zlib zlib-devel git-core

RUN cd / && wget http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz \
 && tar -zxvf nginx-$NGINX_VERSION.tar.gz \
 && rm -rf nginx-$NGINX_VERSION.tar.gz \
 && cd nginx-$NGINX_VERSION \
 && ./configure --prefix=/usr/local/nginx \
 && make \
 && make install \
 && cd .. \
 && rm -rf nginx-$NGINX_VERSION

RUN mkdir -p /nginx/conf && mkdir /nginx/logs/

EXPOSE 80 443

COPY start.sh /

RUN chmod 777 /start.sh

CMD ["/start.sh"]